package RLK_HIBERNATE;

import lombok.SneakyThrows;
import org.hibernate.Session;
import org.hibernate.engine.spi.SessionFactoryImplementor;

public class Example_02 {
    private SessionFactoryImplementor factory;

    @SneakyThrows
    public void makePersistent(final Object[] keys) {
        Session session = factory.openSession();
        try {
            session.beginTransaction();

            for (final Object key : keys) {
                session.persist(key);
            }
        } finally {
            session.close();
        }
    }
}
